/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package fr.sorbonne.soa.entity;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author Nairo
 */
@Entity
@Table(name = "SHIPPERINFO")
@NamedQueries({@NamedQuery(name = "Shipperinfo.findAll", query = "SELECT s FROM Shipperinfo s"), @NamedQuery(name = "Shipperinfo.findByShippingcompanyid", query = "SELECT s FROM Shipperinfo s WHERE s.shippingcompanyid = :shippingcompanyid"), @NamedQuery(name = "Shipperinfo.findByCompanyname", query = "SELECT s FROM Shipperinfo s WHERE s.companyname = :companyname"), @NamedQuery(name = "Shipperinfo.findBySpeciality", query = "SELECT s FROM Shipperinfo s WHERE s.speciality = :speciality")})
public class Shipperinfo implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "SHIPPINGCOMPANYID")
    private String shippingcompanyid;
    @Column(name = "COMPANYNAME")
    private String companyname;
    @Basic(optional = false)
    @Column(name = "SPECIALITY")
    private String speciality;
    @OneToMany(mappedBy = "shipper")
    private Collection<Customerorder> customerorderCollection;

    public Shipperinfo() {
    }

    public Shipperinfo(String shippingcompanyid) {
        this.shippingcompanyid = shippingcompanyid;
    }

    public Shipperinfo(String shippingcompanyid, String speciality) {
        this.shippingcompanyid = shippingcompanyid;
        this.speciality = speciality;
    }

    public String getShippingcompanyid() {
        return shippingcompanyid;
    }

    public void setShippingcompanyid(String shippingcompanyid) {
        this.shippingcompanyid = shippingcompanyid;
    }

    public String getCompanyname() {
        return companyname;
    }

    public void setCompanyname(String companyname) {
        this.companyname = companyname;
    }

    public String getSpeciality() {
        return speciality;
    }

    public void setSpeciality(String speciality) {
        this.speciality = speciality;
    }

    public Collection<Customerorder> getCustomerorderCollection() {
        return customerorderCollection;
    }

    public void setCustomerorderCollection(Collection<Customerorder> customerorderCollection) {
        this.customerorderCollection = customerorderCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (shippingcompanyid != null ? shippingcompanyid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Shipperinfo)) {
            return false;
        }
        Shipperinfo other = (Shipperinfo) object;
        if ((this.shippingcompanyid == null && other.shippingcompanyid != null) || (this.shippingcompanyid != null && !this.shippingcompanyid.equals(other.shippingcompanyid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "fr.sorbonne.soa.entity.Shipperinfo[shippingcompanyid=" + shippingcompanyid + "]";
    }

}
